import { createApp } from 'vue'
import App from './App.vue'
import router from './router/index'
import { createPinia } from 'pinia'
import { setupNaiveUI } from '@/plugins'
import { setupStore } from '@/store'
import { setupRoute } from '@/router'

// const app = createApp(App)

// app.use(router)

// app.use(createPinia())

// app.mount('#app')

async function setupApp() {
	const app = createApp(App)

	// 挂载pinia
	setupStore(app)

	// 按需引入pinia
	setupNaiveUI(app)

	// 引入路由
	await setupRoute(app)

	app.mount('#app')
}

setupApp()
